#!/usr/bin/env bash
set -Eeuo pipefail

git config --global user.name "oh-qemu-docker"
git config --global user.email "no-reply@gmail.com"

curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/repo 
chmod a+x ~/repo
export PATH=$PATH:$HOME
echo 'export PATH=$PATH:$HOME' >> ~/.bashrc
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

mkdir -p ohos-5.0.2
cd ohos-5.0.2
if [ ! -f /usr/bin/python ]; then
    ln -s /usr/bin/python3 /usr/bin/python
fi
if [ ! -f ./initialized ]; then
    repo init -u https://gitee.com/open-harmony-edu-dist/manifest -b refs/heads/OpenHarmony-5.0.2-Release --no-repo-verify
fi
touch initialized
repo sync -c && repo forall -c 'git lfs pull'
build/prebuilts_download.sh

./build.sh --product-name x86_64_virt

